package com.activity.adapter;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.Display;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.activity.CategoryActivity;
import com.activity.SubCategoryListActivity;
import com.activity.bean.CategoryBean;
import com.activity.bean.OpusBean;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
import com.bumptech.glide.request.RequestOptions;
import com.example.apple.ddhr_new.R;
import com.example.apple.ddhr_new.adapter.BaseAdapter;
import com.example.apple.ddhr_new.utils.ActivityUtil;
import com.example.apple.ddhr_new.utils.ImageViewUtil;
import com.example.apple.ddhr_new.utils.ScreenUtil;

import org.apache.commons.lang3.StringUtils;

import java.util.ArrayList;
import java.util.Arrays;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.ButterKnife;
import co.lujun.androidtagview.TagContainerLayout;
import co.lujun.androidtagview.TagView;

public class SubCategoryListAdapter extends BaseAdapter<OpusBean> {




    public SubCategoryListAdapter(Context context) {
        super(context);
    }

    @Override
    public BaseViewHolder<OpusBean> getViewHolder(int viewType, View view) {

        return new PersonalHolder(view);
    }


    @Override
    public boolean hasHeader(int groupPosition) {
        return  false;
    }





    @Override
    public int getChildLayout(int viewType) {
        return R.layout.item_sub_personal_cell;
    }



    @Override
    public void onBindChildViewHolder(com.donkingliang.groupedadapter.holder.BaseViewHolder holder, int groupPosition, int childPosition) {
        super.onBindChildViewHolder(holder, groupPosition, childPosition);



    }



    public class PersonalHolder extends BaseViewHolder<OpusBean> {

        @BindView(R.id.iv_icon)
        ImageView ivIcon;


        public PersonalHolder(@NonNull View itemView) {
            super(itemView);
            ButterKnife.bind(this, itemView);
        }

        public void setData(OpusBean data) {



            if (data.images().size() > 0) {

                RequestOptions options =new RequestOptions();

//                RoundedCorners roundedCorners = new RoundedCorners(0);
                options = options.override(300,300);
                options.placeholder(R.drawable.default_work);
                Glide.with(mContext).load(data.images().get(0)).apply(options).into(ivIcon);

            } else {
                ivIcon.setImageResource(R.drawable.meinv);
            }





        }


    }


}
